#include "mystdio.h"
#include "mystring.h"

#include <unistd.h>
#include <string.h>

int main()
{
    MyFile* filep = myOpen("log.txt", "w");
    if(filep == NULL)
    {
        printf("myOpen failed.");
        return 1;
    }
    const char* msg = "hello bit\n";
    int cnt = 10;
    while(cnt--)
    {
        myFwrite((void*)msg, sizeof(char), mystrlen(msg) - 1, filep);
        myFflush(filep);
        printf("outbuffer: %s\n", filep->outbuffer);
        sleep(1);
    }

    myClose(filep);


    return 0;
}
